home *** CD-ROM | disk | FTP | other *** search
/ Cracking 1 / Cracking I..iso / Tools / Debuggery / TRW2000 / PLUGSDK / INCLUDE / PLUGS.H < prev   
Encoding:
C/C++ Source or Header  |  2000-04-26  |  6.9 KB  |  345 lines

  1.  
  2. #ifndef    _PLUGS_H_
  3. #define _PLUGS_H_
  4.  
  5. #pragma pack(1)        // yes, must be here!
  6.  
  7. extern "C" {
  8. #define WANTVXDWRAPS
  9. #include <basedef.h>
  10. #include <VMM.H>
  11. #include <vxdwraps.h>
  12. }
  13.  
  14. typedef DWORD            PHOOKER;
  15. typedef DWORD*            PPHOOKER;
  16.  
  17. #ifndef STDCALL
  18. #define STDCALL            __stdcall
  19. #endif
  20.  
  21. #ifndef EXC
  22. #define EXC            extern "C"
  23. #endif
  24.  
  25. #ifndef EXPORT
  26. #define EXPORT            _declspec(dllexport)
  27. #endif
  28.  
  29. #define    pd            *(DWORD *)
  30. #define    pw            *(WORD *)
  31. #define pb            *(BYTE *)
  32.  
  33. #define    KEY_ESC                0x011b
  34. #define    KEY_ENTER            0x1c0d
  35. #define    KEY_TAB                0x0f09
  36. #define    KEY_LEFT            0x4be0
  37. #define    KEY_RIGHT            0x4de0
  38. #define    KEY_HOME            0x47e0
  39. #define    KEY_END                0x4fe0
  40. #define    KEY_BACKSPACE        0x0e08
  41. #define    KEY_DEL                0x53e0
  42. #define    KEY_INSERT            0x52e0
  43. #define    KEY_C_PGUP            0x84e0
  44. #define    KEY_C_PGDN            0x76e0
  45. #define    KEY_C_LEFT            0x73e0
  46. #define    KEY_C_RIGHT            0x74e0
  47. #define    KEY_C_UP            0x8de0
  48. #define    KEY_C_DOWN            0x91e0
  49. #define    KEY_A_LEFT            0x9be0
  50. #define    KEY_A_RIGHT            0x9de0
  51. #define    KEY_A_PGUP            0x9900
  52. #define    KEY_A_PGDN            0xa100
  53. #define    KEY_A_UP            0x9800
  54. #define    KEY_A_DOWN            0xa000
  55. #define KEY_PGUP            0x49e0
  56. #define KEY_PGDN            0x51e0
  57. #define    KEY_UP                0x48e0
  58. #define    KEY_DOWN            0x50e0
  59. #define    KEY_A_G                0x2200
  60. #define    KEY_SPACE            0x3920
  61. #define    KEY_C_A_UP            0x9800
  62. #define    KEY_C_A_DOWN        0xa000
  63. #define    KEY_C_A_LEFT        0x9b00
  64. #define    KEY_C_A_RIGHT        0x9d00
  65. #define    KEY_C_Z                0x2c1a
  66.  
  67. #include <stdarg.h>
  68.  
  69. #define STDDASM                0x10000000
  70. #define STDDATA                0x20000000
  71. #define STDUSER                0x40000000
  72. #define SY_MOVE                0x00000001
  73. #define SY_ZOOM                0x00000002
  74. #define SY_SIZE                0x00000004
  75. #define SY_CLOSE            0x00000008
  76. #define SY_SHADOW            0x00000010
  77. #define SY_TOP                0x00000020
  78.  
  79. struct MouseEvent
  80. {
  81.     int        x;
  82.     int        y;
  83.     WORD    button;
  84. };
  85.  
  86. typedef struct {
  87.         DWORD _off;
  88.         WORD  _seg;
  89.         WORD  _mod;        
  90. } ADDRE, *PADDRE;        
  91.  
  92. struct KeyEvent
  93. {
  94.     WORD    keycode;
  95.     WORD    control;
  96. };
  97.  
  98. struct MessageEvent
  99. {
  100.     WORD    event;
  101.     DWORD    Para_1;
  102.     DWORD    Para_2;
  103. };
  104.  
  105. #define evNOTHING       0
  106. #define evMOUSE         1
  107. #define evKEY           2
  108. #define evMESSAGE       3
  109.  
  110. class TEvent
  111. {
  112. public:
  113.     WORD    what;
  114.     union {
  115.         MouseEvent   mevent;
  116.         KeyEvent     kevent;
  117.         MessageEvent msgevent;
  118.     };
  119. };
  120.  
  121. const
  122.     msgNOMSG     =   0,
  123.     msgACTIVE    =   1,
  124.     msgNOACTIVE  =   2,
  125.     msgCLOSE     =   3,
  126.     msgMOVE      =   4,
  127.     msgSIZE      =   5,
  128.     msgZOOM      =   6,
  129.     msgSCRLINES  =   7,
  130.     msgREFURBISH =   8,
  131.     msgDRAW      =   9,
  132.     msgPREDRAW   =  10,
  133.  
  134.     msgREARRANGESUB    =    11,        //I add
  135. //  evMESSAGE
  136.  
  137.     msgSCROLLUP   =  27,
  138.     msgSCROLLDOWN =  28,
  139.     msgSCROLLPGUP =  29,
  140.     msgSCROLLPGDN =  30,
  141.     msgSCROLLDRAGV=  31,
  142.     msgSCROLLLEFT =  32,
  143.     msgSCROLLRIGHT=  33,
  144.     msgSCROLLPGLT =  34,
  145.     msgSCROLLPGRT =  35,
  146.     msgSCROLLDRAGH=  36,
  147. //  use in scroller
  148.  
  149.     msgCOMMAND    =  56,
  150.     msgDEFAULT    =  57,
  151.     msgOK         =  58,
  152.     msgCANCEL     =  59,
  153.     msgYES        =  60,
  154.     msgNO         =  61,
  155.     msgHELP       =  62,
  156. // use in Dialog
  157.  
  158.     NOMOUSEHIT   =   0,
  159.     MOUSELEFT    =   1,
  160.     MOUSERIGHT   =   2,
  161.     MOUSEMIDDLE  =   4,
  162.     MOUSELEFTDOUBLE  =  8+1,
  163.     MOUSERIGHTDOUBLE =  8+2,
  164.     MOUSEMIDDLEDOUBLE=  8+4,
  165.     MOUSELEFTRELEASE =  16+1,
  166.     MOUSERIGHTRELEASE=  16+2,
  167.     MOUSELEFTAUTO    =  128,
  168.     MOUSERIGHTAUTO   =  129,
  169.     MOUSELEFTHITLINK =  130,
  170.     MOUSERIGHTHITLINK=  131;
  171. //  evMOUSE
  172.  
  173. #define msgFINDHELP     501
  174. #define msgFINDSTACK    502
  175. #define msgFINDZOOMCMD    503
  176. #define msgFIND_UNASM    504
  177. #define msgFIND_DATA    505
  178. #define msgFIND_REG        506
  179. #define msgFIND_LOGCMD    507
  180.  
  181. #define msgUSER         1000
  182.  
  183. typedef struct {
  184.          WORD x;
  185.          WORD y;
  186.          WORD button;
  187. } MOUSE_STATE;
  188.  
  189. struct X86_REG_STRUCT {
  190.        DWORD  _CR0;
  191.        DWORD  _CR2;
  192.        DWORD  _CR3;
  193.        DWORD  _DR0;
  194.        DWORD  _DR1;
  195.        DWORD  _DR2;
  196.        DWORD  _DR3;
  197.        DWORD  _DR6;
  198.        DWORD  _DR7;
  199.        DWORD  _TR3;
  200.        DWORD  _TR4;
  201.        DWORD  _TR5;
  202.        DWORD  _TR6;
  203.        DWORD  _TR7;
  204.        struct {
  205.               WORD  Limit;
  206.               DWORD Base;
  207.               } _GDTR;
  208.        struct {
  209.               WORD  Limit;
  210.               DWORD Base;
  211.               } _IDTR;
  212.        WORD   _LDT;
  213.        WORD   _TR;
  214. };
  215.  
  216. class WNDCLASS
  217. {
  218.  
  219. public:
  220.  
  221.       int   Origin_x;      // Read Only
  222.       int   Origin_y;      // Read Only
  223.       int   Delta_x;
  224.       int   Delta_y;
  225.       int   Offset_x;
  226.       int   Offset_y;
  227.       int   Size_x;        // Read Only
  228.       int   Size_y;        // Read Only
  229.  
  230. };
  231.  
  232. class DASM_WNDCLASS : public WNDCLASS
  233. {
  234. public:
  235.         ADDRE Waddre;
  236. };
  237.  
  238. class DATA_WNDCLASS : public DASM_WNDCLASS
  239. {
  240. public:
  241.       WORD  Data_Number;
  242.       BYTE  Data_Format;
  243. };
  244.  
  245. #define SYM_NOTRELOC    0
  246. #define SYM_RELOCVXD    1
  247. #define SYM_RELOCPE        2
  248. #define SYM_RELOCNE        3
  249. #define SYM_RELOCDOS    4
  250. #define SYM_RELOCUSER    1000
  251.  
  252. #define SYM_TYPE_COMPLEX        0x80000000
  253. #define SYM_TYPE_COMMENT        0x40000000
  254. #define SYM_TYPE_DATA            0x20000000
  255. #define SYM_TYPE_POINT            0x10000000
  256. // These can be used in dynamic-list
  257.  
  258. // TYPE define
  259. #define SYM_NORMALSYM            1
  260.  
  261. #define SYM_DELCOMPLEXSYM    1
  262. #define SYM_GETCOMPLEXSYM    2
  263. #define SYM_SAVECOMPLEXSYM    3
  264. #define SYM_LOADCOMPLEXSYM    4
  265.  
  266. typedef struct _tagCPLSYM {
  267.     DWORD        complex_type;
  268. } SYMCOMPLEXSYM,*PSYMCOMPLEXSYM;    
  269.  
  270. typedef union _tagMYBP {
  271.     struct{
  272.             DWORD reserved1;
  273.             DWORD reserved2;
  274.             DWORD reserved3;
  275.             DWORD reserved4;
  276.     }ubpreserved;    
  277.     struct{
  278.             WORD hwnd;
  279.             WORD msgno;
  280.     }ubpmsg;
  281. } MYBP,*PMYBP;
  282.  
  283. #define BP_IMMED    1
  284. #define BP_ASYNC    2
  285.  
  286. #define BPDR_X    0
  287. #define BPDR_W    1
  288. #define BPDR_R    3    // NOT IMPLEMENT!
  289. #define    BPDR_A    3
  290.  
  291. #define BPDR_BYTE    0
  292. #define    BPDR_WORD    1
  293. #define    BPDR_DWORD    3
  294.  
  295. #define SYSMSG_USER    1000
  296.  
  297. #define DD_ENTERDEBUGGER    1    
  298. #define DD_LEAVEDEBUGGER    2
  299. #define DD_REDRAWSCREEN        3    //Param1: ScreenBuf(8192 byets), Param2: Lines
  300. #define DD_MOUSECURSHOW        4    //Param1: X, Param2: Y
  301. #define DD_MOUSECURHIDE        5    //Param1: X, Param2: Y
  302. #define DD_CURSORCHANGE        6    //Param1: BeginLine, Param2: EndLine
  303. #define DD_CURSORPOS        7    //Param1: X, Param2: Y
  304. #define DD_CURSORSAVE        8    //Param1: Pointer to state (DWORD)
  305. #define DD_CURSORRESTORE    9    //Param1: State(DWORD)
  306.  
  307. //****************************************
  308. #define FS_ReadOnly            0
  309. #define FS_WriteOnly        1
  310. #define FS_ReadWrite        2
  311. #define FS_Share            0x40
  312.  
  313. #define    FS_OnNotExist_Fail        0
  314. #define    FS_OnNotExist_Create    0x1000
  315.  
  316. #define    FS_OnExist_Fail        0
  317. #define    FS_OnExist_Append    0x0100
  318. #define    FS_OnExist_Open        0x0100
  319. #define    FS_OnExist_Trunc    0x0200
  320.  
  321. #define    fopen_append(fname)    fopen(fname,\
  322.         FS_ReadWrite|FS_OnNotExist_Create|FS_OnExist_Append )
  323. #define    fopen_read(fname)    fopen(fname,FS_Share|FS_OnExist_Open )
  324. #define    fopen_create(fname)    fopen(fname,\
  325.         FS_ReadWrite|FS_OnNotExist_Create|FS_OnExist_Trunc )
  326.  
  327. #include "plugapi.h"
  328.  
  329. EXC PLUGS_API*    api;
  330.  
  331. //OK, If you use .CPP file, you must reload operator new and delete,
  332. //add these code to your main .cpp file.
  333.  
  334. //void* cdecl operator new(size_t size)        // Reload NEW !
  335. //{
  336. //    return api->malloc(size);
  337. //}
  338.  
  339. //void cdecl operator delete(void* p)         // Reload DELETE !
  340. //{
  341. //    api->free(p);
  342. //}
  343.  
  344. #endif
  345.